import http, {
	BaseUrl
} from "@/api/report/utils/request.js";

export const createReport = (data) => {
	return http.post('/api/report/create', data, {});
}
/**
 * 获取汇报信息
 */
export const getReportList = (requestParam) => {
	return http.get('/api/report/get', requestParam);
}
/**
 * 创建评论
 * 
 */
export const createComment = (params) => {
	return http.post('/api/report/comment/create', params)
}
/**
 * 获取用户选择构建树
 */
export const sendUserTree = (userId) => {
	return http.get('/api/users/user/tree', {
		userId: userId
	});
}
export const getCommentByReportId = (reportId) => {
	return http.get("/api/report/comment/get", {
		reportId: reportId
	})
}

export const getAttachment = (param) => {
	return BaseUrl + '/api/attachment/get?filename=' + param.fileName + '&path=' + param.path;
}

/**
 * 上传附件
 */
export const uploadAttachment = (_this) => {
	_this.$refs.lFile.upload({
		//替换为你的上传接口地址
		url: BaseUrl + '/api/upload/file',
		// 服务端接收附件的key
		name: 'file',
		type: 'attachment'
		//根据你接口需求自定义 (优先不传content-type,安卓端无法收到参数再传)
		// header: {
		// 	'Authorization': 'bearer eyJhbGciOiJSUzI1NiIsIn',
		// 	'uid': '27682',
		// 	'client': 'app',
		// },
	});
}